package com.monster.controller;

import com.monster.entity.UserEntity;
import com.monster.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * description:
 *
 * @author Yuanml on 2020/12/13 15:29
 */
@Controller
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;
    @RequestMapping("/getById")
    public String getById(Integer id, Model model) {
        UserEntity userEntity = userService.getById(id);
        model.addAttribute("user", userEntity);
        return "userDetails";
    }
}
